
import { Button } from 'antd';
import React, { useState } from 'react'

export default function Index() {

    const [count,setCount] = useState(3);
    

    function addCount(){

        setCount(count+1);

    }

    function decCount(){
        setCount(count-1);
    }

  return (
    <>
    <div>useReducer</div>
    <p>count:{count}</p>
    <Button type="primary" onClick={addCount}>count做加法</Button>
    <Button type="primary" onClick={decCount}>count做减法</Button>
    </>
  )
}

